<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	Date date = new Date();
	SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
	String dateString = formatter.format(date);
	request.setAttribute("dateString", dateString);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> 								
	<head> 		
	    <base target="_self"/>					
		<%@ include file="../jslib/jquerylib.jsp" %>
		<title>查询报告列表</title>
	    <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/lhgdialog/lhgcore.lhgdialog.min.js?skin=mac"></script>
        <link href="<%=request.getContextPath() %>/web/style/layout.css" type="text/css" rel="stylesheet"/>
        <link rel="stylesheet" href="<%=request.getContextPath() %>/jslib/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
        <script type="text/javascript" src="<%=request.getContextPath() %>/jslib/ztree/jquery.ztree.core-3.4.js"></script>
        <script type='text/javascript' src="<%=request.getContextPath() %>/jslib/My97DatePicker/WdatePicker.js" defer="defer"></script>
	       <!-- 删除结果信息返回 -->
	    	<c:if test="${requestScope.message!=null}">
				<script type="text/javascript">
	  	 		     alert('<c:out value="${requestScope.message}"></c:out>');
	  	 		     window.close();
	  			</script>
	        </c:if>
	 
	<script type="text/javascript">
	$(document).ready(function(){
					$("#gridTable").jqGrid({
						url:'<%=request.getContextPath() %>/reportUpdateAction!queryReportUpdateBgList.action?gwmItemSampleId=<%=request.getParameter("gwmItemSampleId")%>&&oldFlowtaskId=<%=request.getParameter("oldFlowtaskId")%>',
						datatype: "json",
						height: 450,
						width: 710, 
						autowidth: true, 
						colNames:['ID','报告名称','报告识别号','修改时间','修改人','报告原文'],
						colModel:[
								{name:'ID',index:'ID', width:100,key:true,hidden:true,sorttype:"int"} ,
								{name:'FILE_NAME',index:'FILE_NAME', width:180},
								{name:'REPORT_SHIBIEHAO',index:'REPORT_SHIBIEHAO', width:170},
								{name:'ADD_TIME',index:'ADD_TIME', width:180},
								{name:'ADD_USER_NAME',index:'ADD_USER_NAME', width:100,hidden:true},
								{name:'FILE_PATH',index:'FILE_PATH', width:280,hidden:false,hidedlg:false,formatter: function(cellvalue, options, rowObject) {
						           return "<a href='javascript:openReportFile("+'"'+rowObject.FILE_PATH+'"'+")'>"+rowObject.FILE_PATH+"</a>" }}
					    
						], 
						shrinkToFit:false,
						sortname:'ID',
						sortorder:'asc',
						viewrecords:true,
						multiselect: false, // 是否显示复选框
						multiboxonly : true, 
						//gridview: true,  //提升速度
						rownumbers: true,//显示行号
						cellEdit: true,
						forceFit : true,
						cellsubmit: "clientArray",
						rownumWidth: 30, //行号的宽度
						rowNum:15,
						rowList:[15,20,50,200,500],
						toolbar: [false,"top"],
						jsonReader: {
							root:"rows",		// 数据行（默认为：rows）
							page: "page",  	// 当前页
							total: "total",  // 总页数
							records: "records",  // 总记录数
							repeatitems : false		// 设置成false，在后台设置值的时候，可以乱序。且并非每个值都得设
						},
						prmNames:{rows:"rows",page:"page",sort:"sidx",order:"sord",search:"search"},
						pager:"#gridPager",
						caption: "样报告列表"
			});
			
				
		      /**
		     * 取消
		     */
		    $("#center").click(function(){
		        window.close();
		    });
	  }); 
	
	  function openReportFile(filepath){
	     
          var returnValue = window.showModalDialog("<%=basePath%>/view/report_update_chakanbaogao.jsp?filepath="+filepath+"&operateType=2",'',"dialogWidth=1050px;dialogHeight=650px;scroll:yes");
      } 
	</script>	
	</head>
	<body>
	<form action="" method="post" id="form1">
	      <table style="width: 100%;" class="tableCont">
	      <input type="hidden" id="id1" name="id1" vlaue=""/>
				<tr>
					<td colspan="4">
						<table id="gridTable"></table>
						<div id="gridPager"></div>
					</td>
				</tr>
			</table>
			<table style="width: 100%;">
			   <tr>
			   <td colspan="4" style="text-align: center; height: 20px; font-size: 15px; font-weight: bold;">
		        <button id="center" class="button_b" >关&nbsp;&nbsp;闭</button>
		       </td>
		      </tr>
			</table>
	</form>
	</body>
</html>
